package main

import "fmt"

func modify(a map[string]int) {
  a["modify001"] = 1000
}

func main() {
  var a map[string]int
  fmt.Printf("a:$v\n",a)

  if a == nil {
    a = make(map[string]int, 16)
    fmt.Printf("a=%v\n",a)
    a["stu01"] = 1000
    a["stu02"] = 1000
    a["stu03"] = 1000
    fmt.Printf("a=%#v\n",a)

    b := a
    b["stu03"] = 2000
    fmt.Printf("after modify a:%v\n",a) //after modify a:map[stu01:1000 stu02:1000 stu03:2000]

    modify(a)
    fmt.Printf("after modify a:%v\n",a) //after modify a:map[modify001:1000 stu01:1000 stu02:1000 stu03:2000]
  }
}
